package wen.recommend.servlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import wen.recommend.dao.UserDao;

//用户注销
public class LogoutServlet extends HttpServlet {

	UserDao userDao = new UserDao();

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doPost(request,response);
	}


	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		//使Sessioin失效
				HttpSession sess = request.getSession();
				sess.invalidate();
				//重定向到首页
				response.sendRedirect("/booksRecommend/bookList");
	}

}
